const mongoose = require("mongoose");
const schema = new mongoose.Schema({
  username: {
    type: String,
  },
  nickName: {
    type: String,
  },
  mobile: {
    type: Number,
  },
  avatarUrl: {
    type: String,
  },
  openId: {
    type: String,
  },
  gender: { type: String },
  city: { type: String },
  province: { type: String },
  country: {
    type: String,
  },
  password: {
    type: String,
    select: false,
    set(val) {
      return require("bcryptjs").hashSync(val, 10);
    },
  },
});
module.exports = mongoose.model("Users", schema);
